package com.proxy.pattern.proxy;

import com.proxy.pattern.service.UserService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author cc
 * @classname UserProxy
 * @description 静态代理-代理对象
 * @date 2022/3/27 13:28
 */
@Slf4j
public class UserProxy implements UserService {

    private UserService userService;

    public UserProxy(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void saveUser() {
        log.info("增强逻辑");
        userService.saveUser();
        log.info("增强逻辑");
    }

    @Override
    public void saveAnimal() {
        log.info("增强逻辑");
        userService.saveAnimal();
        log.info("增强逻辑");
    }
}
